
import sa = module("main/org/sdmx/model/v2/base/SDMXArtefact");
import is = module("main/org/sdmx/model/v2/base/InternationalString");

/**
* Additional descriptive information attached to an object.
* 
* An annotation (or note) is used to convey extra information to describe 
* any SDMX construct. Annotations have a name, are identified by a type, 
* can have a link to a URL and can have a link to a multi-lingual 
* description (provided by an InternationalString).
* 
* @author Xavier Sosnovsky, Anthony Morel
* 
* @see InternationalString
* 
* @todo
* 		Add a validator for the URL
*/
export class Annotation implements sa.SDMXArtefact {
		
	/*==============================Fields================================*/
		
	private _title:string;

	private _type:string;
		
	private _url:string;
		
	private _text:is.InternationalString;
		
	/*===========================Constructor==============================*/
		
	constructor() {
	}
		
	/*============================Accessors===============================*/
		
	/**
	    * The name used to identify an annotation.
	    */
	public getTitle(): string {
		return this._title;
	}
		
	/**
	    * @private
	    */
	public setTitle(title : string):void {
		this._title = title;
	}
		
	/**
	    * Specifies how the annotation is to be processed. It is used to
	    * distinguish between annotations designed to support various uses. The
	    * types are not enumerated, as these can be specified by the user or
	    * creator of the annotations. The definitions and use of annotation 
	    * types should be documented by their creator.
	    */
	public getType():string {
		return this._type;
	}
		
	/**
	    * @private
	    */
	public setType(type:string):void {
        this._type = type;
	}
		
	/**
	    * A link to an external descriptive text. It points to an external 
	    * resource which may contain or supplement the annotation. If a 
	    * specific behavior is desired, an annotation type should be defined 
	    * which specifies the use of this field more exactly.
	    */
	public getUrl():string {
        return this._url;
	}
		
	/**
	    * @private
	    */
	public setUrl(url:string) {
		this._url = url;
	}
    
    /**
        * List of multilingual representations of the text of the annotation.
        */
    public getText(): is.InternationalString {
        return this._text;
	}
    
    /**
        * @private
        */
    public setText(text: is.InternationalString) {
        this._text = text;
	} 
}